import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};


// 周刊 

/** 新增周刊 */
export const weeklyinsertweeknews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/weeknnews/insertweeknews"), { data });
};


/** 删除周刊 */
export const weeklydelweeknews = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/secbackend/weeknnews/delweeknews/${userid}`));
};

/** 修改周刊 */
export const weeklyupdateweeknews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/weeknnews/updateweeknews"), { data });
};

/** 分页查询周刊 */
export const weeklyselweeknewsbypage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi(`/secbackend/weeknnews/selweeknewsbypage`), { data });
};





// 资讯

/** 新增资讯 */
export const newsinsertnews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/news/insertnews"), { data });
};


/** 删除资讯 */
export const newsdelnews = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/secbackend/news/delnews/${userid}`));
};

/** 修改资讯 */
export const newsupdatenews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/news/updatenews"), { data });
};

/** 分页查询资讯 */
export const newsselnewsbypage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi(`/secbackend/news/selnewsbypage`), { data });
};






